<?php
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

require_once(OC_App::getAppPath('resumes') . "/lib/resumes.php");
require_once(OC_App::getAppPath('resumes') . "/lib/search.php");

$model = new PResumesModelSearch();

$term_id = JRequest::getInt('term_id',0);
$syncing = JRequest::getVar('syncing',array());

if (($data=$model->checkSearchResult($term_id,$syncing)) != FALSE) {
   OCP\JSON::success(array('data'=>$data));
} else {
   OCP\JSON::error();
}
